import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess, resultSuccess } from '../_util';

const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 60; index++) {
    result.push({
      id: `${index}`,
      tagId: '@string(lower,16)',
      count: '@integer(1, 8)',
      createTime: '@datetime',
      barcode: '@string(lower,16)',
      'isallocate|1': ['是', '否'],
      // current: '@integer(1, 200)',
      // standbyCurrent: '@integer(1, 200)',
      // startCurrent: '@integer(1, 200)',
      'useState|1': ['是', '否'],
      // 'onlineState|1': ['是', '否'],
      // onlineDuration: '@integer(1, 20)',
      // onlineHistory: '@integer(20, 200)',
    });
  }
  return result;
})();
enum Api {
  list = '/tag-management/tagManagement/list',
  save = '/tag-management/tagManagement/add',
  edit = '/tag-management/tagManagement/edit',
  deleteOne = '/tag-management/tagManagement/delete',
  deleteBatch = '/tag-management/tagManagement/deleteBatch',
  importExcel = '/tag-management/tagManagement/importExcel',
  exportXls = '/tag-management/tagManagement/exportXls',
}
const prefix = '/jeecgboot';
export default [
  // {
  //   url: prefix + Api.list,
  //   timeout: 1000,
  //   method: 'get',
  //   response: ({ query }) => {
  //     const { page = 1, pageSize = 20 } = query;
  //     return resultPageSuccess(page, pageSize, demoList);
  //   },
  // },
  // //定义删除接口
  // {
  //   url: prefix + Api.deleteOne,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // //定义添加接口
  // {
  //   url: prefix + Api.save,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // //定义编辑接口
  // {
  //   url: prefix + Api.edit,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
] as MockMethod[];
